package demo.impl;

import demo.AbstractDiscount;

import java.math.BigDecimal;

/**
 * 折扣优惠卷 （ 具体策略 ）
 * @author ZhouWeiBo
 * @create 2022/6/7
 */
public class SubtractOff extends AbstractDiscount {

    private BigDecimal off = BigDecimal.ZERO;

    public SubtractOff(BigDecimal off) {
        this.off = off;
    }

    @Override
    public int order() {
        return 1;
    }

    @Override
    public BigDecimal discountAmount(BigDecimal bigDecimal) {
        return bigDecimal.multiply(off);
    }
}
